/**
 * Copyright(c): 2017 com.mjduan All rights reserved.
 * 项目名：springcloud-eureka
 * 注意：未经作者允许，不得外传
 */
package com.mjduan.springcloud.project.consumer1.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 通过rest的方式调用其它服务，
 *
 * @author dmj1161859184@126.com mjduan 2018-05-31 15:41
 * @version 1.0
 * @since 1.0
 */
@FeignClient(value = "serviceA-provider")
public interface AddService {

    /**
     * 这个远程服务是一个controller，难道springcloud中所有的服务调用都是走http，即不通过rpc?
     *
     * 通过feign.hystrix.HystrixInvocationHandler，用JDK代理
     *
     * @param a
     * @param b
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/serviceA/add")
    Integer add(@RequestParam(value = "a") Integer a, @RequestParam(value = "b") Integer b);
}
